#include <cstdio>
#include <iostream>
#include <cmath>
using namespace std;
#define int long long
#define fread(x) ios::sync_with_stdio(x)

//int arr[6][6];
int cntyueshu(int x) {
	int cnt = 0;
	for (int i = 1; i < sqrt(x); i++) {
		if ( x % i == 0 ) {
			cnt += 2;
		}
	}
//	cout << (int)sqrt(x) << x % (int)sqrt(x) << endl;
	if (((int)sqrt(x)) * ((int)sqrt(x)) == x) {

		cnt += 1;
	}
	return cnt;
}
signed main() {
	fread(0);
	int temp = 0, tcnt = 0;
	int x;
//	cout << cntyueshu(9);
	for (int i = 0; i < 6; i++) {
		for (int j = 0; j < 6; j++) {
//			cin >> arr[i][j];
			cin >> x;
			
			int tc = cntyueshu(x);
			
			cout << tc <<" ";
			if (tc > tcnt) {
				temp = x;
				tcnt = tc;
			}
		}
		cout << endl;
	}
	
	cout << temp;
	return 0;
}
